<template>
  <div class="ant-list ant-list-split">
    <ul class="ant-list-items">
      <li class="ant-list-item" v-for="item in arr" :key="item.name">
        <div class="ant-list-item-meta">
          <div class="ant-list-item-meta-content">
            <h4 class="ant-list-item-meta-title">{{ item.title }}登录</h4>
            <div class="ant-list-item-meta-description" v-if="item.value">
              已绑定{{ item.title }}：<span class="strong">{{ item.value }}</span>
            </div>
            <div class="ant-list-item-meta-description" v-else>暂未绑定</div>
          </div>
        </div>
        <div class="ant-list-item-action">
          <template v-if="item.value">
            <el-button type="primary" link>更换</el-button>
            <el-divider direction="vertical" />
            <el-button type="primary" link>解绑</el-button>
          </template>
          <template v-else>
            <el-button type="primary" link>绑定</el-button>
          </template>
        </div>
      </li>
    </ul>
  </div>
</template>

<script lang="ts" setup>
const arr = [
  {
    name: 'qq',
    title: 'QQ',
    value: '9464***929',
  },
  {
    name: 'wechat',
    title: '微信',
    value: 'li***sign',
  },
  {
    name: 'github',
    title: 'Github',
  },
  {
    name: 'wechat_mini_program',
    title: '微信小程序',
  },
  {
    name: 'gitee',
    title: 'Gitee',
  },
  {
    name: 'oschina',
    title: '开源中国',
    value: 'li***sign',
  },
  {
    name: 'dingtalk',
    title: '钉钉',
    value: 'li***sign',
  },
]
</script>

<style lang="less" scoped>
.ant-list {
  width: 100%;
}

.ant-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  color: rgba(0, 0, 0, 0.85);
}

.ant-list-split .ant-list-item {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* .ant-list-split .ant-list-item:last-child {
  border-bottom: none;
} */

.ant-list-item-meta {
  display: flex;
  flex: 1 1;
  align-items: flex-start;
  max-width: 100%;
}

.ant-list-item-meta-content {
  flex: 1 0;
  width: 0;
  color: rgba(0, 0, 0, 0.85);
}

.ant-list-item-action {
  flex: 0 0 auto;
  margin-left: 48px;
  padding: 0;
  font-size: 0;
  list-style: none;
}

.ant-list-item-meta-title {
  margin-bottom: 4px;
  color: rgba(0, 0, 0, 0.85);
  font-size: 14px;
  line-height: 1.5715;
}

.ant-list-item-meta-description {
  color: rgba(0, 0, 0, 0.45);
  font-size: 14px;
  line-height: 1.5715;
}
</style>
